package com.bkgy.modular.gzTechnologyDetermine.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.gzTechnologyDetermine.service.GztechnologyDetermineService;
import com.bkgy.sys.common.entity.ResultData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/gztechnologyDetermine")
public class GztechnologyDetermineController {

    @Resource
    private GztechnologyDetermineService gztechnologyDetermineService;

    @PostMapping("/findByData")
    public ResultData findByData(@RequestBody JSONObject jsonObject) {
        return gztechnologyDetermineService.findByData(jsonObject);
    }

    @PostMapping("/findByDatapd")
    public ResultData findByDatapd(@RequestBody JSONObject jsonObject) {
        return gztechnologyDetermineService.findByDatapd(jsonObject);
    }

    @PostMapping("/findByMongDbData")
    public ResultData findByMongDbData(@RequestBody JSONObject jsonObject) {
        return gztechnologyDetermineService.findByMongDbData(jsonObject);
    }


    @PostMapping("/findByMongDbDatahotcrown")
    public ResultData findByMongDbDatahotcrown(@RequestBody JSONObject jsonObject) {
        return gztechnologyDetermineService.findByMongDbDatahotcrown(jsonObject);
    }

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx")
    public void export(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        gztechnologyDetermineService.export(jsonObject,response);
    }

    /***
     * 镀锌生产计划 审核
     * @param json
     * @return
     */
    @PostMapping("/findDataByPage")
    public ResultData findDataByPage(@RequestBody JSONObject json){
        return gztechnologyDetermineService.findDataByPage(json);
    }


    /***
     * 镀锌生产计划历史
     * @param json
     * @return
     */
    @PostMapping("/findDataHis")
    public ResultData findDataHisByPage(@RequestBody JSONObject json){
        return gztechnologyDetermineService.findDataHisByPage(json);
    }

}
